<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger("cate_id")->default(0)->comment("分类ID");
            $table->string("title",255)->comment("标题");
            $table->string("desn",255)->default("")->comment("描述");
            $table->string("author",50)->default("")->comment("作者");
            $table->string("pic",255)->default("")->comment("封面");
            $table->text("body")->comment("内容");
            $table->unsignedInteger("click")->default(0)->comment("阅读数");
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
